﻿
Public Structure ImageDimensions

    Private _Height As Integer
    Private _Width As Integer

#Region "Properties"
    Public Property Height() As Integer
        Get
            Return _Height
        End Get
        Set(ByVal value As Integer)
            _Height = value
        End Set
    End Property

    Public Property Width() As Integer
        Get
            Return _Width
        End Get
        Set(ByVal value As Integer)
            _Width = value
        End Set
    End Property
#End Region

#Region "Constructors"
    Sub New(ByVal Height As Integer, ByVal Width As Integer)
        _Height = Height
        _Width = Width
    End Sub
#End Region

#Region "Overloaded Operators"
    Public Shared Operator >(ByVal id1 As ImageDimensions, ByVal id2 As ImageDimensions) As Boolean
        Return (id1.Height * id1.Width) > (id2.Height * id2.Width)
    End Operator

    Public Shared Operator <(ByVal id1 As ImageDimensions, ByVal id2 As ImageDimensions) As Boolean
        Return (id1.Height * id1.Width) < (id2.Height * id2.Width)
    End Operator

    Public Shared Operator =(ByVal id1 As ImageDimensions, ByVal id2 As ImageDimensions) As Boolean
        If (id1.Height = id2.Height) AndAlso (id1.Width = id2.Width) Then
            Return True
        Else
            Return False
        End If
    End Operator

    Public Shared Operator <>(ByVal id1 As ImageDimensions, ByVal id2 As ImageDimensions) As Boolean
        If (id1.Height = id2.Height) AndAlso (id1.Width = id2.Width) Then
            Return False
        Else
            Return True
        End If
    End Operator
#End Region

End Structure
